﻿using BySoft.Server.Common;
using BySoft.Server.Common.Entity;
using BySoft.Server.DataAccess;
using BySoft.Server.DataAccess.UserCode;
using OneSoft.DataAccess;
using OneSoft.EntityCore;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace BySoft.Server.Business
{
    public partial class BsKnifeuse
    {

        public static bool CheckExist(string KnifeuseIDValue)
        {

            return ClsComm.CheckExist("BS_Knifeuse", "BillID", KnifeuseIDValue, true);
           
        }
        public static bool CheckUsed(string BillIDValue)
        {

            bool result = false;
            return result;

        }
        public static bool SaveOrUpdate(BsKnifeuseEntity entity, DataTable KnifeuseDetailDT, bool isNew)
        {
            return BsKnifeuseDA.SaveOrUpdate(entity, KnifeuseDetailDT, isNew);
        }

        public static bool Del(string strCode)
        {
            return BsKnifeuseDA.Del(strCode);
        }

        public static DataTable SelectList(string strBillID, string strKnifeID,
           string strFrom, string strEnd, int pageIndex, int PageSize, out int m_count)
        {
            return BsKnifeuseDA.SelectList(strBillID, strKnifeID, 
                strFrom, strEnd, pageIndex, PageSize, out m_count);
        }

         /// <summary>
        /// 排程单中没有结案的才能领用
        /// 
        /// </summary>
       
        /// <returns></returns>
        public static DataTable SelectCanUseKnife(string strCurrentID, string strKnifeID, string strKnifeTypeID,
            string strWorkOrderNo, int pageIndex, int PageSize, out int m_count)
        {
            return BsKnifeuseDA.SelectCanUseKnife(strCurrentID, strKnifeID, strWorkOrderNo, strKnifeTypeID,
                pageIndex, PageSize, out m_count);
        }

           public static DataTable SelectHeadData(string strBillID)
           {
               return BsKnifeuseDA.SelectHeadData(strBillID);
           }
           public static DataTable SelectDetailData(string strBillID)
           {
               return BsKnifeuseDA.SelectDetailData(strBillID);
           }



           public static DataTable SelectReturnUser()
           {
               return BsKnifeuseDA.SelectReturnUser();
           }
         
           public static DataTable CreateDT()
           {
               return SelectHeadData("-1");
           }


           public static DataTable CreateDetailDT()
           {
               return SelectDetailData("-1");
           }
    }
}
